#include <vulkan/vulkan_core.h>
#define GLFW_INCLUDE_VULKAN
#include <GLFW/glfw3.h>
#include <cstdlib>
#include <exception>
#include <iostream>
using  namespace std;

const uint32_t WIDTH = 800;
const uint32_t HEIGHT = 600;

class HelloTriangleApplication{

    public:
        void run(){

            initWindow();

            initVulkan();

            mainLoop();
        }

        ~HelloTriangleApplication(){
          
        }

    protected:
        void initWindow(){
            glfwInit();
            /* Because GLFW was originally designed to create an OpenGL context, 
            we need to tell it to not create an OpenGL context with a subsequent call:*/

            glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
            //关闭窗口大小调节
            glfwWindowHint(GLFW_RESIZABLE, GLFW_FALSE);

            window = glfwCreateWindow(WIDTH, HEIGHT, "triangle test", nullptr, nullptr);
        }
        void initVulkan(){

            VkApplicationInfo appInfo;

            appInfo.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO;
            appInfo.pApplicationName = "Hello Triangle";
            appInfo.applicationVersion = VK_MAKE_VERSION(1, 0, 0);
            appInfo.pEngineName = "No Engine";
            appInfo.engineVersion = VK_MAKE_VERSION(1, 0, 0);
            appInfo.apiVersion = VK_API_VERSION_1_0;

            vkCreateInstance(const VkInstanceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator, &vkInstance)

        }
        void mainLoop(){
            while (!glfwWindowShouldClose(window)) {
                glfwPollEvents();
            }
        }
        void cleanUp(){
            glfwDestroyWindow(window);
            glfwTerminate();
        }

    private:
        GLFWwindow * window;
        VkInstance * vkInstance;
};

int main(void){

    HelloTriangleApplication app;

    try {
        app.run();
    } catch (const exception &e) {
        cerr << e.what() << endl;
    }

    return EXIT_SUCCESS;
}